package com.itheima.reggie.mapper;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.reggie.entity.Orders;
import com.itheima.reggie.entity.OrdersExport;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrderMapper extends BaseMapper<Orders> {
    List<OrdersExport> selectToExport();

    @Select("select DATE_FORMAT(order_time,'%Y-%m') as times,sum(amount) as sums from orders   group by DATE_FORMAT(order_time,'%Y-%m')")
    public List<JSONObject> selectEachAnalysis();
}
